package com.knowledge.RMIClient;

import com.knowledge.RMIService.IRMIService;

import java.rmi.Naming;

/**
 * Created by mike on 2016/12/4.
 */
public class StartClient {
    public static void main(String args[]){
        try {
            //在RMI服务注册表中查找名称为RHello的对象，并调用其上的方法
            IRMIService rhello =(IRMIService) Naming.lookup("rmi://localhost:8888/RHello");
            System.out.println(rhello.sayHello());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
